from typing import List,Optional
from app.core.crud import CRUDBase
from app.models.admin import Menu
from app.schemas.menus import MenuCreate,MenuUpdate

class MenuController(CRUDBase[Menu,MenuCreate,MenuUpdate]):
    def __init__(self):
        super().__init__(Menu)

    async def get_menu_path(self,path:str) -> Optional["Menu"]:
        return await self.model.filter(path=path).first()

menu_controller = MenuController()

